home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kasyncio.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.5 KB  |  86 lines

  1. /*
  2.  *  This file is part of the KDE libraries
  3.  *  Copyright (C) 2001 Thiago Macieira <thiago.macieira@kdemail.net>
  4.  *
  5.  *  This library is free software; you can redistribute it and/or
  6.  *  modify it under the terms of the GNU Library General Public
  7.  *  License as published by the Free Software Foundation; either
  8.  *  version 2 of the License, or (at your option) any later version.
  9.  *
  10.  *  This library is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  *  Library General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU Library General Public License
  16.  *  along with this library; see the file COPYING.LIB.  If not, write to
  17.  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.  *  Boston, MA 02110-1301, USA.
  19.  */
  20. #ifndef KASYNCIO_H
  21. #define KASYNCIO_H
  22.  
  23.  
  24. #include <qobject.h>
  25. #include <qiodevice.h>
  26. #include "kdelibs_export.h"
  27.  
  28. class KAsyncIOPrivate;
  29. /**
  30.  * Asynchronous I/O Support
  31.  *
  32.  * This abstract class provides basic functionality for asynchronous I/O
  33.  * support on top of QIODevice.
  34.  *
  35.  * @author Thiago Macieira <thiago.macieira@kdemail.net>
  36.  * @short Asynchronous I/O support
  37.  */
  38. class KDECORE_EXPORT KAsyncIO: public QObject, public QIODevice
  39. {
  40.   Q_OBJECT
  41. protected:
  42.   KAsyncIO()            // cannot be accessed externally
  43.   { }
  44.  
  45. private:
  46.   KAsyncIO(KAsyncIO&);
  47.  
  48.   KAsyncIO& operator=(KAsyncIO&);
  49.  
  50. public:
  51.   /**
  52.    * Toggles the emission of the readyRead() signal whenever the device
  53.    * is ready for reading. This is useful if you want to know the first time
  54.    * the device is ready for reading and you don't want to read it now.
  55.    * @param enable true to enable, false to disable the readyRead() signal
  56.    */
  57.   virtual void enableRead(bool enable) = 0;
  58.  
  59.   /**
  60.    * Toggles the emission of the readyWrite() signal whenever the device
  61.    * is ready for writing. This is useful if you want to know the first time
  62.    * the device is ready for writing and you don't want to write to it now.
  63.    * @param enable true to enable, false to disable the readyWrite() signal
  64.    */
  65.   virtual void enableWrite(bool enable) = 0;
  66.  
  67. signals:
  68.  
  69.   /**
  70.    * This signal gets sent when the device is ready for reading.
  71.    */
  72.   void readyRead();
  73.  
  74.   /**
  75.    * This signal gets sent when the device is ready for writing.
  76.    */
  77.   void readyWrite();
  78. protected:
  79.     /** \internal */
  80.   virtual void virtual_hook( int id, void* data );
  81. private:
  82.   KAsyncIOPrivate* d;
  83. };
  84.  
  85. #endif // KASYNCIO_H
  86.